package com.bj58.groupbuy.action.service;

import java.util.HashSet;
import java.util.List;
import java.util.TreeMap;

import com.bj58.groupbuy.action.model.OperMenu;
import com.bj58.groupbuy.action.model.User;
import com.bj58.groupbuy.action.model.UserOperPriviledge;

/**操作细粒度Service
 * @author huangliang
 *
 */
public interface UserOperService {

	/**获取某用户所有操作权限集
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public HashSet<Long>  getUserOpers(long userId)throws Exception;
	
	
	/**获取所有正常的操作细粒度权限列表
	 * @return
	 * @throws Exception
	 */
	public List<OperMenu>  getAllOpers()throws Exception;
	
	
	/**获取所有正常的操作细粒度权限列表 ( 按cate1+cate2分组)
	 * @return
	 * @throws Exception
	 */
	public TreeMap<String, List<OperMenu>>  getAllOpersMap()throws Exception;
	
	/**批量新增用户操作权限
	 * @param operList
	 * @return
	 * @throws Exception
	 */
	public boolean inserUserOpers(List<UserOperPriviledge> operList)throws Exception;
	
	
	/**删除某用户的所有操作权限
	 * @param userid
	 * @return
	 * @throws Exception
	 */
	public boolean deleteOpersByUser(long userid)throws Exception;
	
	
	/**检查某用户是否包含某个操作权限
	 * @param user
	 * @param operid
	 * @return
	 * @throws Exception
	 */
	public boolean checkUserOper(User user,int operid)throws Exception;
	
	
	/**根据类别获取对应的操作权限列表（正常 state = 0 )
	 * @param cate1
	 * @param cate2
	 * @return
	 * @throws Exception
	 */
	public List<OperMenu> getOperListByCate(String cate1,String cate2)throws Exception;
	
	
	/**获取某角色所有操作权限集
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public HashSet<Long>  getRoleOpers(long roleid)throws Exception;
}
